package com.mongo.service;

import com.mongo.func.SFunction;
import com.mongo.service.impl.LambdaMongoUpdate;
import org.springframework.data.mongodb.core.query.Query;

/**
 * 提供mongo的lambda更新操作
 * @author xiazhun
 * @create 2022/6/8
 */
public interface LambdaUpdate<T>{

    LambdaMongoUpdate<T> set(SFunction<T,?> function, Object value);

    LambdaMongoUpdate<T> set(boolean condition, SFunction<T,?> function, Object value);

    LambdaMongoUpdate<T> eq(SFunction<T,?> function, Object value);

    LambdaMongoUpdate<T> eq(boolean condition, SFunction<T,?> function, Object value);

    long update();

    long update(Query query);
}
